package com.google.gwt.sample.dynatablerf.client.views;

import com.google.gwt.event.dom.client.HasClickHandlers;
import com.google.gwt.sample.dynatablerf.client.presenters.ProjetoStartPresenter.ProjetoStartDisplay;
import com.google.gwt.sample.dynatablerf.client.theme.GrifoTheme;
import com.google.gwt.sample.dynatablerf.client.theme.GrifoTheme.GrifoImageResources;
import com.google.gwt.sample.dynatablerf.client.util.GrifoConstants;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;

public class ProjetoStartView extends Composite implements ProjetoStartDisplay {

	private Button materialButton;
	private Button servicoButton;

	public ProjetoStartView() {
		HorizontalPanel horizontalPanel = new HorizontalPanel();
		initWidget(horizontalPanel);

		Image image = new Image(GrifoImageResources.INSTANCE.iconMaterial());

		Label label = GrifoTheme.getLabelPadrao();
		label.setText(GrifoConstants.INSTANCE.materiais());

		materialButton = GrifoTheme.getButtonPadrao(image, label);

		Image image2 = new Image(GrifoImageResources.INSTANCE.iconServico());

		Label label2 = GrifoTheme.getLabelPadrao();
		label2.setText(GrifoConstants.INSTANCE.servicos());

		servicoButton = GrifoTheme.getButtonPadrao(image2, label2);

		horizontalPanel.add(materialButton);
		horizontalPanel.add(servicoButton);
	}

	@Override
	public Widget getTabHeader() {
		HorizontalPanel horizontalPanel = new HorizontalPanel();
		Label label = GrifoTheme.getLabelPadrao();
		label.setText(GrifoConstants.INSTANCE.dadosGerais());
		horizontalPanel.add(label);
		return horizontalPanel;
	}

	@Override
	public HasClickHandlers getMaterialClickHandlers() {
		return materialButton;
	}

	@Override
	public HasClickHandlers getServicoClickHandlers() {
		return servicoButton;
	}
}
